<?php
namespace app\index\controller;
//引用空间类元素
use think\Controller;
class Base extends Controller
{
    public function _initialize()
    {	
    	$cates=db('cate')->order('id desc')->limit(7)->select();
    	$this->assign('cates',$cates);
    	$this->hotClick();
    }

    public function hotClick(){
    	$hotClick=db('article')->order('click desc')->limit(4)->select();
    	$recommend=db('article')->where('state',1)->limit(4)->select();
    	$this->assign(array(
    		'hotClick'=>$hotClick,
    		'recommend'=>$recommend,
    	));
    }
}
